#ifndef _DIRECTORY_ENTRY_H
#define _DIRECTORY_ENTRY_H
#include <string>
using namespace std;


/**
 * FILE_NAME_MAX_CHARS sets the maximum length of a file.
 * Presently 123 characters.
 */
#define FILE_NAME_MAX_CHARS 122

/**
 * An entry in a Directory, think of this in general as a "file".
 * @author Timothy Millard <mill4138@d.umn.edu>
 *
 */

class DirectoryEntry {
public:
  /** Constructor for a DirectoryEntry
   * @param FCB Block number for File Control Block.
   * @param new_filename Name for the Entry (file name).
   */
  DirectoryEntry(int FCB, string new_filename) {
      FCB_block_number = FCB;
      file_name = new_filename;
  };

  /**
   * file_name - name of the DirectoryEntry
   *
   * If we need to convert from string to char array, something like:
      char *a=new char[s.size()+1];
      a[s.size()]=0;
      memcpy(a,s.c_str(),s.size());
   */
  string file_name;

  /**
   * Block number of the File Control Block (FCB).
   */
  unsigned int FCB_block_number;

  /**
   * Default DirectoryEntry size in bytes.
   */
  static const unsigned int DEFAULT_FILE_NAME_DATA_LENGTH = FILE_NAME_MAX_CHARS + 1; // 1 byte for NULL terminater
  static const unsigned int DEFAULT_DIRECTORY_ENTRY_SIZE = DEFAULT_FILE_NAME_DATA_LENGTH + 4; // 127 bytes


};

#endif  /* _DIRECTORY_ENTRY_H */

